package com.lokyiu.mybible.db.sqlite;

import android.database.sqlite.SQLiteDatabase;

import com.lokyiu.mybible.db.sqlite.def.BookColumns;
import com.lokyiu.mybible.db.sqlite.def.ChapterColumns;
import com.lokyiu.mybible.db.sqlite.def.Columns;
import com.lokyiu.mybible.db.sqlite.def.VerseColumns;

public class DBDefinition {

	static Columns[] DEFINITIONS = { new BookColumns(), new ChapterColumns(), new VerseColumns() };
	
	public void onCreate(SQLiteDatabase db) {
		for (Columns c : DEFINITIONS) {
			c.onCreate(db);
		}
	}
	
	public void onUpgrade(SQLiteDatabase db) {
		for (Columns c : DEFINITIONS) {
			c.dropTable(db);
			c.onCreate(db);
		}
	}
}
